home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 23
/
Amiga Format AFCD23 (Feb 1998, Issue 107).iso
/
+look_here_1st!+
/
reader_requests
/
alienbreed3d2
/
ams
/
ams.amosSourceCode
Wrap
AMOS Source Code
|
1997-11-28
|
2KB
|
127 lines
Reserve As Work 15,320*256
Dim C(31,31)
Repeat
Screen Open 0,640,256,2,Hires
Curs Off : Flash Off : Cls 0
Colour 1,$FFF
Dim R(255),G(255),B(255)
F$=Fsel$("ab3:graphics/walls","","Load Wall Picture","")
If F$="" Then End
Load Iff F$,1
Bload F$,Start(15)
S=Start(15)+94
For A=0 To 31
R(A)=Peek(S) : Add S,1
G(A)=Peek(S) : Add S,1
B(A)=Peek(S) : Add S,1
Next
End
F$=F$-"ab3:graphics/walls/"
Screen 0 : Screen To Front 0
Input "Width of chunk: ";W
Input "Height of chunk: ";H
NOL=W/3
NOL=NOL
Screen 1 : Screen To Front 1
X=0 : Y=0
AP=Start(15)
For A=0 To 31
C(A,0)=Colour(A) : Next
'
For A=1 To 31
V=32-A
For Q=0 To 31
LR=C(Q,A-1) and $F00
LG=C(Q,A-1) and $F0
LB=C(Q,A-1) and $F
LR=LR/$100
LG=LG/$10
R=C(Q,0) and $F00
G=C(Q,0) and $F0
B=C(Q,0) and $F
R=R/$100 : G=G/$10
R=(R*V)/32
G=(G*V)/32
B=(B*V)/32
R=R and $F
G=G and $F
B=B and $F
D=Abs(LR-R)+Abs(LG-G)+Abs(LB-B)
If D>500
If LG<>G and LB<>B and LR<>R
R=LR : G=LG
Else
If LR<>R and LG<>G
R=LR
Else
If LR<>R and LB<>B
R=LR
Else
If LG<>G and LB<>B
G=LG
End If
End If
End If
End If
End If
C(Q,A)=R*$100+G*$10+B
Next
Next
For A=0 To 31
For B=0 To 31
Doke AP,C(B,A)
Add AP,2
Next
Next
D=AP
X=0 : Y=0
For L=0 To NOL
For V=0 To H-1
C= Extension_12_044C(X,Y+V)
Extension_12_036E X,Y+V,0
Doke D,C : Add D,2
Next
Add X,3
If X>319 Then X=X-320 : Y=Y+H
Next
D=AP
X=1 : Y=0
For L=0 To NOL
For V=0 To H-1
C= Extension_12_044C(X,Y+V)*32
Extension_12_036E X,Y+V,0
Doke D,C+Deek(D)
Add D,2
Next
Add X,3
If X>319 Then X=X-320 : Y=Y+H
Next
D=AP
X=2 : Y=0
For L=0 To NOL
For V=0 To H-1
C= Extension_12_044C(X,Y+V)*32*32
Extension_12_036E X,Y+V,0
Doke D,C+Deek(D)
Add D,2
Next
Add X,3
If X>319 Then X=X-320 : Y=Y+H
Next
F$=Fsel$("ab3:includes/Walls",F$,"Select Save Name","")
If F$="" Then End
Bsave F$+".wad",Start(15) To D
Until 0